<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
var FYsuiji = function (nums){
    let x,k
    for( var i = nums.length-1 ; i>0 ; i-- ){
        k = Math.floor( Math.random() * (i+1) )
        // [ nums[k] , nums[i] ] = [ nums[i] , nums[k] ]  很奇怪不知道为什么不可以这样换
        x = nums[k]
        nums[k] = nums[i]
        nums[i] = x
    }
    return nums
}
let nums=[5,4,3,2,1,4,11,223,455,44,2211,99]
console.log(FYsuiji(nums))
    </script>
</body>
</html>